﻿package 
{
    import flash.utils.*;
    import morn.core.components.*;

    public class RenderItemFactory extends Object
    {
        private var _viewDic:Dictionary;

        public function RenderItemFactory()
        {
            this._viewDic = new Dictionary();
            return;
        }// end function

        public function add(param1, param2:Object) : void
        {
            if (!this._viewDic[param1])
            {
                this._viewDic[param1] = new Array();
            }
            this._viewDic[param1].push(param2);
            return;
        }// end function

        public function getItem(param1:Object, param2:Class) : Component
        {
            var _loc_3:Component = null;
            if (!param2)
            {
                return null;
            }
            if (!this._viewDic[param1] || this._viewDic[param1].length == 0)
            {
            }
            else
            {
                _loc_3 = this._viewDic[param1].shift();
            }
            return _loc_3;
        }// end function

    }
}
